package com.wfh.mianshiji.ws.model.enums;

import lombok.Getter;

/**
 * @Title: MessageTypeEnum
 * @Author wangfenghuan
 * @Package com.wfh.mianshiji.ws.model.enums
 * @Date 2025/10/31 15:59
 * @description:
 */
@Getter
public enum MessageTypeEnum {

    /**
     * 面试状态枚举
     */
    START("开始", "start"),
    DOING("进行中", "doing"),
    FINISHED("已完成", "finished"),
    HEARTBEAT("心跳", "heartbeat"),
    ERROR("错误", "error");

    private String text;
    private String value;
    MessageTypeEnum(String text, String value){
        this.text = text;
        this.value = value;
    }

    public MessageTypeEnum getByValue(String value){
        for (MessageTypeEnum messageTypeEnum : MessageTypeEnum.values()) {
            if (messageTypeEnum.value.equals(value)){
                return messageTypeEnum;
            }
        }
        return null;
    }

}
